package c.c.a;

import android.content.Context;
import android.util.DisplayMetrics;
import com.huawei.agconnect.exception.AGCServerException;
import com.huawei.hms.adapter.internal.CommonCode.MapKey;
import org.json.JSONObject;

public class d extends b2 {
    public final Context e;

    public d(Context context) {
        super(true, false);
        this.e = context;
    }

    public boolean b(JSONObject jSONObject) {
        Object obj;
        DisplayMetrics displayMetrics = this.e.getResources().getDisplayMetrics();
        int i = displayMetrics.densityDpi;
        switch (i) {
            case 120:
                obj = "ldpi";
                break;
            case 240:
                obj = "hdpi";
                break;
            case 260:
            case 280:
            case 300:
            case 320:
                obj = "xhdpi";
                break;
            case 340:
            case 360:
            case AGCServerException.AUTHENTICATION_INVALID /*400*/:
            case 420:
            case 440:
            case 480:
                obj = "xxhdpi";
                break;
            case 560:
            case 640:
                obj = "xxxhdpi";
                break;
            default:
                obj = "mdpi";
                break;
        }
        jSONObject.put("density_dpi", i);
        jSONObject.put("display_density", obj);
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(displayMetrics.heightPixels);
        stringBuilder.append("x");
        stringBuilder.append(displayMetrics.widthPixels);
        jSONObject.put(MapKey.HAS_RESOLUTION, stringBuilder.toString());
        return true;
    }
}
